<?php
include ("head.php");
include ("db.php");
$sql = "select * from video where id='".$_GET["id"]."'";
$result = mysql_query($sql);
$rs=mysql_fetch_array($result);
mysql_close($con);
?>
<iframe
	width=174 height=172 name="gToday:normal:calendar/agenda.js"
	id="gToday:normal:calendar/agenda.js" src="calendar/ipopeng.htm"
	scrolling="no" frameborder="0"
	style="visibility: visible; z-index: 999; position: absolute; left: -500px; top: 0px;"></iframe>
<?if($rs["id"]!=""){?>
<form name="form1" action="car_manage.php?method=update" method="post">
<?}else{?>
<form name="form1" action="car_manage.php?method=add" method="post"><?}?>
<div class="Main_body" id="Main_body">
<div class="Main_locationBar" id="Main_locationBar">
<div class="Main_locationBar_head"></div>
<div class="Main_locationBar_body"><span id="CurrentPosition">Location：Videos
&gt; <?if($rs["id"]!=""){?>Edit<?}else{?>Add<?}?>&nbsp Video</span></div>
<div class="Main_locationBar_foot"></div>
</div>
<div class="Main_handleBar check_pass" id="Main_handleBar"
<?if($msg==""){?> style="display: none" <?}?>>
<div class="Main_handleBar_head"></div>
<div class="Main_handleBar_body">
<p><?echo $msg;?></p>
</div>
<div class="Main_handleBar_foot"><a href="javascript:void(0)"
	class="close" onclick="closeHandleBar()"></a></div>
</div>
<div class="Main_bodyAddBar">
<div class="Main_bodyAddBar_head"></div>
<div class="Main_bodyAddBar_body">
<table width="100%" border="0" cellpadding="0" cellspacing="1"
	class="addTable">
	<tbody>
		<tr>
			<td class="title">Title：<em>*</em></td>
			<td class="content2"><span class="content"> <input type="text"
				id="cphm" name="cphm" class="input_long" value="<?=$rs["cphm"]?>" />
			<input type="hidden" name="companyId" class="input_long"
				value="<?if($rs["id"]!='')echo $rs["company_id"];else echo $company_id?>" />
			<input type="hidden" name="id" class="input_long"
				value="<?=$rs["id"]?>" /> </span></td>
		</tr>
		<tr>
			<td class="title">Video Path：<em>*</em></td>
			<td class="content2"><span class="content"> <input type="text"
				id="cplx" name="cplx" class="input_long" value="<?=$rs["cplx"]?>" readonly/>
			<select name="" onclick="toValue(this.value,'cplx')">
				<option value="">-请选择-</option>
				<option value="卡车" <?if($rs["cplx"]=='卡车')echo "selected"?>>卡车</option>
				<option value="客车" <?if($rs["cplx"]=='客车')echo "selected"?>>客车</option>
				<option value="小车" <?if($rs["cplx"]=='小车')echo "selected"?>>小车</option>
			</select> </span></td>
		</tr>

		<tr>
			<td class="title">Image Path：<em>*</em></td>
			<td class="content2"><span class="content"> <input type="text"
				name="sydw" class="input_long" value="<?=$rs["sydw"]?>" readonly/> </span></td>
		</tr>

		<tr>
			<td class="title">门禁卡号：<em>*</em></td>
			<td class="content2"><span class="content"> <input type="text"
				name="mjkh" class="input_long" value="<?=$rs["mjkh"]?>" /> </span></td>
		</tr>
<!--		<tr>-->
<!--			<td class="title">年检时间：</td>-->
<!--			<td class="content2"><span class="content"> <input name="njsj"-->
<!--				type="text" class="input_long_int" maxlength="10"-->
<!--				value="<?=$rs["njsj"]?>" /> <a-->
<!--				onclick="gfPop.fPopCalendar(document.form1.njsj);return false;"><img-->
<!--				name="popcal" align="absmiddle" src="calendar/calbtn.gif" width="34"-->
<!--				height="22" border="0" alt="日历标签" /></a> </span></td>-->
<!--		</tr>-->
	</tbody>
</table>
</div>

<div class="Main_bodyAddBar_foot"></div>
</div>

<div class="Main_buttonGroupBar">
<div class="Main_buttonGroupBar_head"></div>
<div class="Main_buttonGroupBar_body"><input name="button" type="button"
	class="button" value="保存" onclick="toSubmit()" /></div>
<div class="Main_buttonGroupBar_foot"></div>
</div>
</div>
</form>
<script>
			function toValue(value,name){
				document.getElementById(name).value=value;
			}
			function toSubmit(){
				var cphm =document.form1["cphm"].value;
				var cpxh =document.form1["cpxh"].value;
				var cplx =document.form1["cplx"].value;
				var sydw =document.form1["sydw"].value;
				var mjkh =document.form1["mjkh"].value;
				var cbgh =document.form1["cbgh"].value;
				var dmzt =document.form1["dmzt"].value;
				var njzt =document.form1["njzt"].value;
				
				if(cphm==""){
					alert("请输入车牌号码");
					return ;
				}
				if(cpxh==""){
					alert("请输入厂牌型号");
					return ;
				}
				if(cplx==""){
					alert("请输入车辆类型");
					return ;
				}
				if(sydw==""){
					alert("请输入使用单位或个人");
					return ;
				}
				if(mjkh==""){
					alert("请输入门禁卡号");
					return ;
				}
				if(cbgh==""){
					alert("请输入存包柜号");
					return ;
				}
				if(dmzt==""){
					alert("请输入待命状态");
					return ;
				}
				if(njzt==""){
					alert("请输入年检状态");
					return ;
				}
				
				
				document.form1.submit();
			} 
</script> <?php
include ("end.php");
?>